#include "Level.h"

Level::Level()
{

}

void Level::draw()
{
    Image* bg = getBackgroundImage();

    int bgWidth = bg->getWidth();
    int temp = Viewport::drawX(0) + bg->getWidth(); // RHS of level image

    while(temp < 0) temp += bgWidth;    // Loop until RHS is on the screen

    temp -= bgWidth;  // Get LHS

    // Draw until LHS is off the screen
    while(temp < Window::getInstance()->getWidth())
    {
        bg->draw(temp,0);
        temp += bgWidth;
    }
}
